package com.heima.kafka.listener;

import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

@Component
public class HelloListener {

    /*@KafkaListener(topics = "springboot-topic")
    public void onMessage(String message){
        System.out.println(message);
    }*/

    @KafkaListener(topics = "springboot-topic")
    public void onMessage2(ConsumerRecord<String,String> record){
        System.out.println(record.partition());
        System.out.println(record.key());
        System.out.println(record.value());
        System.out.println(record.offset());
    }
}
